extends "../calxJS_Hide/calxJS_Hide.gd"
func _init():
	pass
func _extInit():
	._extInit()
	chaName = "小可兰"                   # 角色的名称
	attCoe.atkRan = 3                 # 攻击距离
	attCoe.maxHp = 5.5                  # 最大生命（每点代表112.5基础数值，取整数，下同）
	attCoe.atk = 6.5                    # 攻击力（每点代表8.5）
	attCoe.mgiAtk = 2.5                 # 魔法攻击（每点代表13.7）
	attCoe.def = 4                    # 物理防御（每点代表15）
	attCoe.mgiDef = 4                 # 魔法防御（每点代表16.6）
	atkEff = "atk_gongJian" 
	xb = "木"
	lv = 3
	addSkillTxt("[岚灵箭]射出岚灵箭攻击敌方单体，造成130%木系物理伤害并削弱目标攻速20%,持续5秒,60%概率令目标中<剧毒>4秒[CD:6]")
	addSkillTxt("[灵箭苍穹]箭指苍穹，攻击目标3次，每次造成66%的王系物理伤害并提升魔攻以外的任意属性10%，各属性最高至60%[CD:10]")
	addSkillTxt("[春木之歌]聆听春木之歌，提升自身双防20%，最高60%，恢复28%已损失体力值[CD:15]")
	addCdSkill("llj",6)
	addCdSkill("ljcq",9)
	addCdSkill("cmzg",13)   

func _castCdSkill(id):
	._castCdSkill(id)
	if id == "llj":
		var eff = sys.newEff("numHit", position, false, 1)
		eff.setText("岚灵箭", "#FF0099")
		eff.anim.set_speed_scale(0.2)
		typeHurtCha(aiCha,att.atk*1.3,Chara.HurtType.MGI,Chara.AtkType.SKILL)
		aiCha.addBuff(bf.jgongsu.new(5))
		if sys.rndPer(60):
			addBuff(bf.zhongdu.new(4))
	if id == "ljcq":
		var eff = sys.newEff("numHit", position, false, 1)
		eff.setText("灵箭苍穹", "#FF0099")
		eff.anim.set_speed_scale(0.2)
		for i in range(3):
			typeHurtCha(aiCha,att.atk*0.66,Chara.HurtType.PHY,Chara.AtkType.SKILL,"王")
		shuxing()
	if id == "cmzg":
		var eff = sys.newEff("numHit", position, false, 1)
		eff.setText("春木之歌", "#FF0099")
		eff.anim.set_speed_scale(0.2)
		cmzg()
		yield(reTimer(0.2),"timeout")
		cmzg()
		plusHp((att.maxHp - att.hp)*0.28)

func cmzg():
	var buff = hasBuff("wukang1")
	if buff == null:
		addBuff(bf.wukang1.new())
	elif buff.att.defL < 0.6:
		buff.att.defL += 0.1
	var buff1 = hasBuff("mokang1")
	if buff1 == null:
		addBuff(bf.mokang1.new())
	elif buff1.att.mgiDefL < 0.6:
		buff1.att.mgiDefL += 0.1

func shuxing():
	var n = sys.rndRan(1,5)
	if n == 1:
		var buff = hasBuff("gongsu1")
		if buff == null:
			addBuff(bf.gongsu1.new())
		elif buff.att.spd < 0.6:
			buff.att.spd += 0.1
	if n == 2:
		var buff = hasBuff("wugong1")
		if buff == null:
			addBuff(bf.wugong1.new())
		elif buff.att.atkL < 0.6:
			buff.att.atkL += 0.1
	if n == 3:
		var buff = hasBuff("wukang1")
		if buff == null:
			addBuff(bf.wukang1.new())
		elif buff.att.defL < 0.6:
			buff.att.defL += 0.1
	if n == 4:
		var buff = hasBuff("mokang1")
		if buff == null:
			addBuff(bf.mokang1.new())
		elif buff.att.mgiDefL < 0.6:
			buff.att.mgiDefL += 0.1
	if n == 5:
		var buff = hasBuff("baoji1")
		if buff == null:
			addBuff(bf.baoji1.new())
		elif buff.att.cri < 0.6:
			buff.att.cri += 0.1
